//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Logging Application Block
//===============================================================================
// License: http://www.codeplex.com/entlibcontrib/Project/License.aspx
// Author: Randy
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder;
using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration;
using EntLibContrib.Logging.Formatters;

namespace EntLibContrib.Logging.Configuration
{
	/// <summary>
	/// Represents the configuration settings for a custom template text formatter.
	/// </summary>
	[Assembler(typeof(TemplateTextFormatterAssembler))]
	public class TemplateTextFormatterData : TextFormatterData, ITemplateTextFormatterData
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="TemplateTextFormatterData"/> class with default values.
		/// </summary>
		public TemplateTextFormatterData() : base()
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="TemplateTextFormatterData"/> class with a template.
		/// </summary>
		/// <param name="templateData">Template containing tokens to replace.</param>
		public TemplateTextFormatterData(string templateData)
			: this("unnamed", templateData)
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="TemplateTextFormatterData"/> class with a name and template.
		/// </summary>
		/// <param name="name">The name of the formatter.</param>
		/// <param name="templateData">Template containing tokens to replace.</param>
		public TemplateTextFormatterData(string name, string templateData)
			: this(name, typeof(TemplateTextFormatter), templateData)
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="TemplateTextFormatterData"/> class with a name and template.
		/// </summary>
		/// <param name="name">The name of the formatter.</param>
		/// <param name="formatterType">The type of the formatter.</param>
		/// <param name="templateData">Template containing tokens to replace.</param>
		public TemplateTextFormatterData(string name, Type formatterType, string templateData)
			: base(name, formatterType, templateData)
		{
		}
	}
}
